//
//  myController.h
//  iListTest
//
//  Created by Ronnie on 08-10-18.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "myOutlineView.h"
#import "FXDataCenter.h"
#import "AddBuddyController.h"
#import "FXAccountInfoController.h"


@class MainAppController;
@class MainWindowController;
@class DialogWindowController;
@class FXToolTipController;

@interface ListController : NSViewController {
	
	//fetion data
	MainWindowController*			mainWindowCtrl;
	MainAppController*				mainAppCtrl;
	FXDataCenter *					myFetionData;
	FXTreeNode *					buddyList;
	
	//ui
	IBOutlet myOutlineView *		outlineView;
	IBOutlet NSWindow*				changeNameWindow;
	IBOutlet NSWindow*				addBuddyWindow;
	IBOutlet NSTextField*			textField;
	DialogWindowController*			dialogWindowController;
	AddBuddyController*				addBuddyCtrl;
	FXToolTipController*			fxToolTipCtrl;
}

- (IBAction)onClick:(id)sender;
- (IBAction)onDoubleClick:(id)sender;
- (IBAction)onShowAccountInfo:(id)sender;
- (IBAction)onMoveGroupBuddy:(id)sender;
- (IBAction)onAddOrRemoveBlackList:(id)sender;
- (IBAction)onDeleteBuddy:(id)sender;
- (IBAction)onDeleteGroup:(id)sender;

- (void)setMainWindowController:(MainWindowController*)p;
- (void)setMainAppController:(MainAppController*)p;

- (void)addNotificationResponser;
- (void)reloadData:(NSNotification*)notification;
- (void)reStoreTooltipTrackingArea:(NSNotification*)notification;
- (void)reloadItem:(id)item;
- (void)changStageById:(FXSysMessage*)sysMessage;
- (void)moveGroupOKWith:(FXSysMessage*)sysMessage;
- (void)changeUserLocalName:(FXSysMessage*)sysMessage;
- (void)changeGroupName:(FXSysMessage*)sysMessage;
- (void)deleteBuddy:(FXSysMessage*)sysMessage;
- (void)deleteGroup:(FXSysMessage*)sysMessage;
- (void)addGroup:(FXSysMessage*)sysMessage;
- (void)addBuddy:(FXSysMessage*)sysMessage;

- (void)loadGroupNamesForMenu;

////////
- (IBAction)showChangeNameSheet:(id)sender;
- (IBAction)endChangeNameSheet:(id)sender;
- (void)changeName:(NSWindow *)sheet returnCode:(int)returnCode context:(void *)contextInfo;
- (IBAction)showAddGroupInputNameSheet:(id)sender;
- (void)AddGroupByName:(NSWindow *)sheet returnCode:(int)returnCode context:(void *)contextInfo;
- (IBAction)showAddBuddySheet:(id)sender;
- (IBAction)endAddBuddySheet:(id)sender;
- (void)AddBuddy:(NSWindow *)sheet returnCode:(int)returnCode context:(void *)contextInfo;
@end
